In most cases, Git is smart enough
to know how files should be modified when were merging branches, however,
that's not always the case. Imagine that Sarah started
working on the fourth story, but she didn't communicate this with Max. So, Max also started working
on the fourth story, Sarah was a bit quicker though and
merged her changes back into Master. Max now wants to go ahead and
merge his change into Master as well, but the Master branch contains changes
compared to the Max branch in a file that we're currently trying to merge. However, the file within Master
says this is Sarah's version, whereas Max's version says
this is Max's version. Git doesn't know which
version you want to keep and we just ended up in a merge conflict. There are several ways to
resolve those conflicts, for example in Git GUI's or
simply in the code editor. During a conflict, Git adds some extra
characters to the file that's conflicting, Git shows the current context of
the conflicting files as well as the contents that we're trying to merge. We can simply remove the lines
that we don't want to keep and leave the lines that we do want to keep,
and then save the file again. During the conflict, we made some
changes to the fourth story TXT file, which we'll have to add to git again. After adding it, we can finally merge
the match branch without any conflicts. Master now contains a combination
of Max's and Sarah's changes.